export default {
	data() {
		return {

		}
	},
	computed: {
        
	},
	
	methods: {
		checkBaseInfo(item) {
			let params = {};
			if(this.crmType == 'contacts'){
				params = {
					crmId: item.contactsId,
					crmType: 'contacts',
                    data: item
				}
			}

			if(['customer','leads', 'pool'].includes(this.crmType)){
				params = {
					crmId: item.customerId,
                    recordId: item.examineRecordId,
                    ownerUserId: item.ownerUserId || '',
					crmType: 'customer',
                    data: item
				}
			}
			console.log(params)
			uni.navigateTo({
				url: "/pages/customerManagement/common/CrmBaseInfo?params=" + encodeURIComponent(JSON.stringify(params))
			})
		},
		// 0待审核、1审核中、2审核通过、3已拒绝 4已撤回 5未提交 修正 以 getStatusName 为准
		getStatusStyle(row, type) {
			const status = row.checkStatus;
			const is_accept = row.isAccept;
			let result = '';
			// type 1--border  2-- backgroundColor  3--color
			if (status == 0) {
				switch (type) {
					case 1:
						result = '1px solid #E6A23C';
						break;
					case 2:
						result = '#FDF6EC';
						break;
					case 3:
						result = '#E6A23C';
						break;
				}
			} else if (status == 3) {
				switch (type) {
					case 1:
						result = '1px solid #409EFF';
						break;
					case 2:
						result = '#ECF5FF';
						break;
					case 3:
						result = '#409EFF';
						break;
				}
			} else if (status == 1) {
				// if (is_accept == 1) {
				// 	switch (type) {
				// 		case 1:
				// 			result = '1px solid #67C23A';
				// 			break;
				// 		case 2:
				// 			result = '#67C23A';
				// 			break;
				// 		case 3:
				// 			result = '#FFF';
				// 			break;
				// 	}
				// } else if (is_accept == 0) {
				// 	switch (type) {
				// 		case 1:
				// 			result = '1px solid #E6A23C';
				// 			break;
				// 		case 2:
				// 			result = '#E6A23C';
				// 			break;
				// 		case 3:
				// 			result = '#FFF';
				// 			break;
				// 	}
				// } else {
				// 	switch (type) {
				// 		case 1:
				// 			result = '1px solid #67C23A';
				// 			break;
				// 		case 2:
				// 			result = '#F0F9EB';
				// 			break;
				// 		case 3:
				// 			result = '#67C23A';
				// 			break;
				// 	}
				// }
				switch (type) {
					case 1:
						result = '1px solid #67C23A';
						break;
					case 2:
						result = '#F0F9EB';
						break;
					case 3:
						result = '#67C23A';
						break;
				}

			} else if (status == 2) {
				switch (type) {
					case 1:
						result = '1px solid #F56C6B';
						break;
					case 2:
						result = '#FEF0F0';
						break;
					case 3:
						result = '#F56C6B';
						break;
				}
			} else if (status == 4 || status == 5) {
				switch (type) {
					case 1:
						result = '1px solid #EEE';
						break;
					case 2:
						result = '#FFFFFF';
						break;
					case 3:
						result = '#000';
						break;
				}
			} else if (status == 6) {
				switch (type) {
					case 1:
						result = '1px solid #E9E9EB';
						break;
					case 2:
						result = '#F4F4F5';
						break;
					case 3:
						result = '#909399';
						break;
				}
			}
			return result;
		},

		getStatusName(row) {
			const status = row.checkStatus;
			const is_accept = row.isAccept;
			if (status == 0) {
				return '待审核'
			} else if (status == 1) {
				// if (is_accept == 1) {
				// 	return '已分配'
				// } else if (is_accept == 0) {
				// 	return '待接受'
				// }
				return '通过'
			} else if (status == 2) {
				return '拒绝'
			} else if (status == 3) {
				return '审核中'
			} else if (status == 4) {
				return '撤回'
			} else if (status == 5) {
				return '未提交'
			} else if (status == 6) {
				return '已作废'
			}
			return ''
		},


	}
}
